package channel

import (
	"fmt"
	"sync"
)

func ToChannel(ch chan<- int, wg *sync.WaitGroup) {
	for i := 0; i < 100; i++ {
		ch <- i
	}
	close(ch)
	wg.Done()
}
func FromChannel(ch <-chan int, wg *sync.WaitGroup) {
	for i := range ch {
		fmt.Printf("%d ", i)
	}
	wg.Done()
}
